<%@ page contentType="text/html;charset=UTF-8"%>
<%@ page import="com.maoye.ossp.sys.org.util.UserUtils" %>
<c:set var="currentUserId" value="<%=UserUtils.getCurrentUserId()%>"/>
<c:set var="currentUserName" value="<%=UserUtils.getCurrentUserName()%>"/>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
		<header class="navbar top_bg navbar-fixed-top nav_red" role="navigation">
	    	<div class="container top_bg_2">
              <div class="navbar-header col-lg-2" style="padding:0px;">
			    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-navbar-collapse">
			      <span class="sr-only">Toggle navigation</span>
			      <span class="icon-bar"></span>
			      <span class="icon-bar"></span>
			      <span class="icon-bar"></span>
			    </button>
			    <a class="navbar-brand" href="${contextPath}/index.html" style="padding-bottom: 10px;"><img alt="" src="${staticPath}/images/logo.png">&nbsp;&nbsp;</a>
			  </div>
			  <div class="collapse navbar-collapse" id="bs-navbar-collapse">
                   <ul class="nav navbar-nav menu">
	                   	<c:forEach items='${ossp:getNavListBySiteCode("index")}' var="nav">
	                   	    <c:if test="${nav.permission!=null&&nav.permission!=''}">
	                   	    <shiro:hasPermission name="${nav.permission}">
							<c:choose>
								<c:when test="${nav.isDropdown==1}">
									<li class="dropdown" id="${nav.id}"><a href="#" class="dropdown-toggle"
										data-toggle="dropdown">${nav.name}<b class="caret"></b></a>
										<ul class="dropdown-menu">
											<c:forEach items='${nav.chidren}' var="chidren">
												<li <%-- <c:if test="${chidren.id  == navId}">class="active" data-p-id="${nav.id}"</c:if> --%>><a href="${contextPath}/${chidren.id}-index.html"
													target="${chidren.target}">${chidren.name}</a></li>
											</c:forEach>
										</ul></li>
								</c:when>
								<c:otherwise>
									<li <%-- <c:if test="${nav.id  == navId}">class="active"</c:if> --%>><a href="${contextPath}/${nav.id}-index.html"
										target="${nav.target}">${nav.name}</a></li>
								</c:otherwise>
							</c:choose>
							</shiro:hasPermission>
						    </c:if>
						</c:forEach>
                       <li class="dropdown" style="display: none;"><a href="index.html"><b class="icon_3 icon"></b>身边的茂业</a></li>
                   </ul>
                   <ul class="nav col-sm-2 nav_1" style="margin-left: 30px;">
                       <li>
                          <div class="col-sm-2">
                            <input type="input" class="form_3" id="exampleInputEmail1" placeholder="站内搜索">
                            <i class="glyphicon glyphicon-search search_1"></i>
                          </div>
                       </li>
                   </ul>
                   <ul class="nav navbar-nav navbar-right menu">
                       <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="glyphicon glyphicon-user"></span>&nbsp;${currentUserName}</a></li>
                       <li class="dropdown" style="display: none;">
                           <a href="#" class="dropdown-toggle" data-toggle="dropdown"><div class="glyphicon glyphicon-envelope"></div></a>
                           <ul class="dropdown-menu MaoYe-dropdown-menu">
			                    <li><a href="#">我的邮件</a></li>
			               </ul>
                       </li>
                       <li class="dropdown">
			               <a href="#" class="dropdown-toggle" data-toggle="dropdown"><div class="glyphicon glyphicon-cog"></div></a>
			               <ul class="dropdown-menu">
			                    <li><a href="#">设置</a></li>
			                    <li><a href="#" data-toggle="modal" data-target="#updatePwdModal">修改密码</a></li>
			                    <li><a href="#" data-toggle="modal" data-target="#changeSkinModal">切换皮肤</a></li>
			                    <li><a href="<c:url value="/logout"/>">退出</a></li>
			               </ul>
			           </li>
			       </ul>
              </div>
			</div>
			<script type="text/javascript">
			function updatePwd()
			{
				$("#oldPassword").val("");
				$("#newPassword").val("");
				$("#newPassword2").val("");
				$("#msg").html("");
				$('#updatePwdModal').modal('show');
			}
			</script>
		</header>
		<%@ include file="/WEB-INF/views/include/changePwd.jsp"%>
		<%@ include file="/WEB-INF/views/include/changeSkin.jsp"%>